package com.novacloud.controller;

import com.novacloud.core.BaseController;
import com.novacloud.core.Result;
import com.novacloud.mq.MqSender;
import com.novacloud.redis.PersonService;
import com.novacloud.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author <a href="mailto:huzhanjun@novacloud.com">huzj</a>
 * @version 1.0
 * @date 2017/9/21 9:59
 */
@Api("首页模块")
@RestController
//@PropertySource("classpath:version.properties")
@RequestMapping("/api/home")
public class HomeController extends BaseController{
    private static Logger logger = LoggerFactory.getLogger(HomeController.class);

    @Autowired
    public PersonService personDao;

    @Autowired
    public UserService userService;

    @Autowired
    public MqSender mqSender;

    @Value("${spring.profiles.active}")
    private String host;

    @ApiOperation(value = "获取所有信息")
    @GetMapping(value = "")
    public Result home(String parameter) {
//        Assert.notNull(null, "parameter");
        mqSender.helloSend(parameter);
//        mqSender.testSender(parameter);
        return resultSuccess(host);

    }
}
